<script lang="ts">
import Vue from 'vue'

import SchoolInfo from "./components/SchoolInfo.vue";

export default ({
  name: "App",
  data() {
    return {
      msg: 'Hello Vue 2.0 + Vite'
    }
  },
  components: {
    SchoolInfo
  },
  methods: {
    showDOM() {
      console.log(this.$refs.title)//真实DOM元素
      console.log(this.$refs.btn)//真实DOM元素
      console.log(this.$refs.sch)//School组件的实例对象(vc)
    }
  }
})
</script>

<template>
  <div>
    <h1 v-text="msg" ref="title"></h1>
    <button @click="showDOM" ref="btn">点我输出上方DOM元素</button>
    <SchoolInfo ref="sch"/>
    <SchoolInfo/>
    <SchoolInfo/>
  </div>
</template>

<style scoped>

</style>